package org.sunflower.util.ssh2;

import java.util.HashMap;
import java.util.Map;

/*
 * 重新部署项目
 */
public class ReDeployment extends ASSH2Bulid{
	public final static String hostname = "192.168.1.232";		//服务器ip
	public final static String username = "root";				//用户名
	public final static String password = "hjzx123";			//登录密码
	static Map<String,String> map = new HashMap<String,String>();
	static{
		map.put("hostname", hostname);
		map.put("username", username);
		map.put("password", password);
	}
	
	public static void doReDeployment(){
		map.put("project", SSH2Bulid.PRO_ctop_admin);//项目名称
		map.put("operaType", SSH2Bulid.OPERA_TYPE_0);//操作类型 :0-重新部署     1-重新启动
		String reDeployment = SSH2Bulid.execShell(map);
		System.out.println(reDeployment);
	}
	
	public static void exectShell(){
		
		String shellPath = "/usr/ytu/restartTomcat.sh";
		//shellPath = "/usr/ytu/reDeployment.sh";
		ASSH2Bulid.execCommand(map,shellPath);
	}
	public static void main(String[] args) {
		exectShell();
	}
}

